package sivin.uikit.extend

import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import sivin.uikit.R


fun AppCompatActivity.jumpToFragment(
    containerViewId: Int, fragment: Fragment, tag: String
) {
    supportFragmentManager.beginTransaction()
        .setCustomAnimations(
            R.anim.fragment_enter,
            R.anim.fragment_exit,
            R.anim.fragment_enter,
            R.anim.fragment_exit
        )
        .add(containerViewId, fragment, tag)
        .addToBackStack(null)
        .commitAllowingStateLoss()
}